﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace VFC.Nes.Ppu
{
    class PpuRegister
    {
        private static int tmp = 0;

        /*
         * VBlank
         * 
         */

        public static void SetVblankFlag()
        {
            tmp = Cpu.Memory.Read(0x2002);
            Cpu.Memory.Write(0x2002, tmp |= 0x80);
        }

        public static void ClearVblankFlag()
        {
            tmp = Cpu.Memory.Read(0x2002);
            Cpu.Memory.Write(0x2002, tmp &= 0x7f);
        }

        public static int GetVblankFlag()
        {
            return (Cpu.Memory.Read(0x2002) & 0x80) >> 0x07;
        }

    }
}
